@extends('admin._layouts.default')

@section('main')

      <div class="row-fluid ">
        <div class="span12 box gradient ">
      <div class="title">
            <div class="row-fluid">
                <h3><button class="btn btn-primary btn-mini pull-right" style="margin:5px 5px 0 0">只看未处理</button>
                  <i class=" icon-shopping-cart"></i> 订单处理
                </h3>
            </div>
        </div><!-- End .title -->
        <div class="content">

            <table id="datatable_in" class="responsive table table-striped" style="width:100%;margin-bottom:0; ">
              <thead>
               <tr>
                 <th width="80">
                   头像
                  </th>
                  <th width="80">
                    <i class="icon-wechat"></i>昵称
                  </th>
                  <th width="80">
                    姓名
                  </th>
                  <th width="120">
                   联系方式
                  </th>
                 <th width="120">
                   个性资料
                 </th>
                 <th>
                   需求信息
                 </th>
                 <th>
                   <i class="icon-magic"></i>搭配方案
                  </th>
                 <th width="120">
                    处理状态
                 </th>
               </tr>
              </thead>
              <tbody>
              @foreach($orders as $order)
              <?php
                $info = json_decode($order['customer']['info']);
                $count = count($order['collocations']);
                if($count > 0){
                    $plan = $order['collocations'][$count-1];
                    $plans = (array)json_decode($plan['plan']);
                }
               ?>
               <tr>
                  <td>
                   <img class="thumbnail small" src="{{ $order['customer']['avatar'] }}">
                  </td>
                 <td>
                    {{ $order['customer']['nickname'] }}
                  </td>
                  <td>
                    {{ $order['customer']['name'] }}
                 </td>
                 <td>
                    <i class=" icon-map-marker"></i> <strong>{{ $order['customer']['address'] }}</strong><br/>
                    <i class=" icon-phone-sign"></i><strong>{{ $order['customer']['tel'] }}</strong>
                 </td>
                 <td>
                    <strong> {{ $info->height }}</strong> × <strong> {{ $info->weight }}</strong>
                 </td>
                 <td class="to_hide_phone">
                    <i class="  icon-home"></i> <strong>场合：</strong>{{ $order['event'] }}<br/>
                    <i class="  icon-edit"></i> <strong>备注：</strong>{{ $order['remark'] }}
                  </td>
                 <td>
                    @if($count == 0)
                        暂无
                    @else
                        <p>
                        @foreach($plans['content'] as $key => $p)
                            @if($p != '')
                                <span class="mg5"><i class="fa fa-tag"></i> {{ $p }} <i class="fa fa-cny"></i>{{ $plans['price'][$key] }}</span>
                            @endif
                        @endforeach
                        </p>
                        <p><i class="fa fa-edit"></i> {{ $plan['remark'] }}</p>
                    @endif
                 </td>
                 <td>
                    @if($order['status'] == 0)
                      <a class="btn btn-small btn-info" href="{{ route('admin.collocations.show',$order['id']) }}">
                        <i class="fa fa-magic"></i> 立即搭配
                    </a>
                    @elseif($order['status'] == 1)
                        <i class="fa  fa-clock-o"></i> 等待反馈
                        <a class="btn btn-small" href="{{ route('admin.collocations.show',$order['id']) }}"><i class="fa fa-eye"></i> 查看详情</a>
                    @elseif($order['status'] == 2)
                        <i class="fa  fa-reply"></i> 客户有反馈
                        <a class="btn btn-small btn-warning" href="{{ route('admin.collocations.show',$order['id']) }}"><i class="fa fa-magic"></i> 重新搭配</a>
                    @elseif($order['status'] == 3)
                          <i class="fa  fa-angellist"></i> 客户已付款
                          <a class="btn btn-small btn-success"  href="{{ route('admin.collocations.show',$order['id']) }}"><i class="fa fa-truck"></i> 立即发货</a>
                    @endif
                 </td>
               </tr>
               @endforeach
               </tbody>
            </table>
                <div class="row-fluid control-group">
                 <div class="pull-left span6" action="#">
                  </div>
                 <div class="span6">
                    <div class="pagination pull-right ">
                      <ul>
                       <li><a href="#">上一页</a></li>
                        <li><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">下一页</a></li>
                      </ul>
                    </div>
                  </div>
                </div>
                <br/>


        </div>
        <!-- End box -->
      </div>
    </div>
    <!-- 内容区域结束 -->


<div id="confirm_alert" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 class="modal-title" id="myModalLabel">确定本次操作吗？</h3>
      </div>
      <div class="modal-body">
        <i class=" icon-warning-sign color_red pull-left fs_24"></i>

        <p>一旦【确定】，本次操作不可撤销。</p>

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary">确定</button>
      </div>
    </div>
  </div>
</div>

@stop

@section('script')
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.peity.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.uniform.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/chosen/chosen/chosen.jquery.min.js') }}"></script>

<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/flot/jquery.flot.js') }}"></script>



<script src="{{ URL::asset('web/js/scripts.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/jnavigate.jquery.min.js') }}"></script>
@stop
